import { request } from "@/utils/request";

export const GetDepartments = async () => {
    const res = await request({
        url: `/api/Department`,
        method: 'get'
    })
    console.log(res)
    return res;
}

export const PostDepartment = (data: any) => {
    return request({
        url: `/api/Department`,
        method: 'post',
        data: data
    })
}

export const PutDepartment = (id: number, data: any) => {
    return request({
        url: `/api/Department/${id}`,
        method: 'put',
        data: data
    })
}

export const DeleteDepartment = (id: number) => {
    return request({
        url: `/api/Department/${id}`,
        method: 'delete'
    })
}